import _ from "lodash";
var abc = function (a, b, c) {
  return [a, b, c];
};
// const curry = _.curry;
// 简单实现
function curry(fn) {
  //   console.log(fn.length);
  let args = [];
  const resultFn = function (...arg) {
    args = args.concat(arg);
    if (args.length >= fn.length) {
      return fn.call(this, ...args);
    }
    return resultFn;
  };
  return resultFn;
}
var curried = curry(abc);

console.log(curried(1)(2)(3));
// => [1, 2, 3]
